package cn.yr.mapper;

import cn.yr.domain.entity.Article;
import cn.yr.domain.vo.ArticleTagVo;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 文章(Article)表数据库访问层
 *
 * @author makejava
 * @since 2020-03-05 20:18:22
 */
public interface ArticleMapper extends BaseMapper<Article> {

    IPage<ArticleTagVo> selectByPage(Page<ArticleTagVo> page, @Param(Constants.WRAPPER) Wrapper<ArticleTagVo> queryWrapper);

    @Select("select * from article where id = #{id}")
    ArticleTagVo selectById(@Param("id") Integer id);

    @Select("select max(id) from article")
    Integer selectMaxId();
}